package com.example.demo.service;

import com.example.demo.mapper.LikeRcountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA 2023.
 * Description:
 * User: 故我
 * Date: 2023-11-27
 * Time: 21:49
 */
@Service
public class LikeRcountService {
    @Autowired
    private LikeRcountMapper likeRcountMapper;

    public int getArtUserEdit(Integer aid, Integer uid) {
        return likeRcountMapper.getArtUserEdit(aid, uid);
    }

    // 插入操作文章的数据 并 将点赞修改为 1
    public int addArtUserEdit(Integer aid, Integer uid) {
        return likeRcountMapper.addArtUserEdit(aid, uid);
    }

    // 将文章的 点赞状态进行 ++
    public int updateArtUserLike(Integer aid, Integer uid) {
        return likeRcountMapper.updateArtUserLike(aid, uid);
    }

    // 获取文章是否点赞的状态
    public int getArtLikeState(Integer aid, Integer uid) {
        return likeRcountMapper.getArtLikeState(aid, uid);
    }

    // 获取文章是否踩的状态
    public int getArtTreadState(Integer aid, Integer uid) {
        return likeRcountMapper.getArtTreadState(aid, uid);
    }

    // 直接将文章的点赞状态 --
    public int delArtUserLike(Integer aid, Integer uid) {
        return likeRcountMapper.delArtUserLike(aid, uid);
    }

    // 将文章的踩状态 进行 ++
    public int updateArtUserTread(Integer aid,Integer uid){
        return likeRcountMapper.updateArtUserTread(aid,uid);
    }

    // 将文章的踩状态进行 --
    public int delArtUserTread(Integer aid,Integer uid){
        return likeRcountMapper.delArtUserTread(aid,uid);
    }
}
